import { Component, OnInit } from '@angular/core';


@Component({
  selector: 'app-lesson3',
  templateUrl: './lesson3.component.html',
  styleUrls: ['./lesson3.component.scss']
})
export class Lesson3Component implements OnInit {
  str1 = '';
  constructor() { }

  ngOnInit() {

  }

  test1() {
    var reg = /^300\d{3}/;
    var fnStr = `${reg}.test('${this.str1}')`;
    var fnRes = reg.test(this.str1);
    return `${fnStr} = ${fnRes}`;
  }
}
